package com.hc.lucene.controller;

import com.hc.lucene.entity.Emp;
import com.hc.lucene.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("emp")
public class EmpController {
    @Autowired
    private EmpService empService;

    @RequestMapping("select/{id}")
    public Emp selectById(@PathVariable Integer id){
        return empService.selectById(id);
    }

    @RequestMapping("selectAll")
    public List<Emp> selectAll(){
        return empService.selectAll();
    }
}
